/**
 * 
 */
package cc.rico.shiro.filter;

import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.filter.mgt.FilterChainManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author rico 2016年6月27日
 *
 */
public class CustomShiroFilterFactoryBean extends ShiroFilterFactoryBean {
	private static final Logger logger = LoggerFactory.getLogger(CustomShiroFilterFactoryBean.class);
	
	@Override
	protected FilterChainManager createFilterChainManager() {
		FilterChainManager manager = super.createFilterChainManager();
		logger.info("###CustomShiroFilterFactoryBean.createFilterChainManager......");
		
		//TODO custom filter chainDefinitions
		// /login.html = anon
	    // /login/authenticate.html = anon
	    // /** = customAccessControlFilter
		manager.createChain("/login.html", "anon");
		manager.createChain("/login/authenticate.html", "anon");
		manager.createChain("/**", "customAccessControlFilter");
		
		return manager;
	}
	
}
